#!/bin/bash
backdir=/home/mysql_backup/$1
pwd=123456root7890

#恢复表数据
for db in sbms rms ejabberd sbmsbak activity qbms
do 
  mysql -uroot -p$pwd -e "create database $db;"
  mysql -uroot -p$pwd $db <$backdir/$db/$db.sql
   for csv  in `ls $backdir/$db|grep \.csv`
   do
   tab=`echo $csv|awk -F. '{print $1}'`
   echo $tab
mysql -uroot -p$pwd <<EOU
use $db;
load data infile '$backdir/$db/$csv' into table $tab FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'; 
EOU
  done
done



#导入触发器
